package com.github.bitsapling.sapling.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 评论表 ：用户发表的评论
 * </p>
 *
 */
public class Comment implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 关联帖子id
     */
    private Long postId;

    /**
     * 评论用户id
     */
    private Long userId;

    /**
     * 评论内容
     */
    private String content;

    /**
     * 评论时间
     */
    private LocalDateTime createdTime;

    /**
     * 评论人
     */
    private String createdBy;

    public String getCreatedBy() {
        return createdBy;
    }
    public void setCreatedBy(String createdBy) {this.createdBy = createdBy;}

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getPostId() {
        return postId;
    }

    public void setPostId(Long postId) {
        this.postId = postId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public LocalDateTime getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(LocalDateTime createdTime) {
        this.createdTime = createdTime;
    }

    @Override
    public String toString() {
        return "Comment{" +
        "id = " + id +
        ", postId = " + postId +
        ", userId = " + userId +
        ", content = " + content +
        ", createdTime = " + createdTime +
        "}";
    }

    public LocalDateTime getCreateTime() {
        return createdTime;
    }
}
